//push events on a stack
//will automatically be reportet to whatever is set in the options
/*Looks up for following Options
	event_URL: server to post data to (please include the "?")
*/
(function (that) {

	//local Link to Global-Object or throw Exception
    	if(!that){throw "Global object missing, bitchesss";}
    	var that = that

	, options = that.get_global_options()

	, counter = 0;

	that.event_send_data = function (params) {

		var query = [];
		for (index in params) {
			if (params.hasOwnProperty(index)) {
				query.push(index + '=' + encodeURI(params[index]));
			}
		}
		query = query.join('&');

		var src 		= options.event_URL + '?' + query;
		var track_img 	= document.createElement("img");

		track_img.onload = function () {
			document.body.removeChild(track_img);
		};

		track_img.id 			= "sauberfant_track_img_" + counter++;
		track_img.style.width 	= "1px";
		track_img.style.height 	= "1px";
		track_img.src			= src;

		document.body.appendChild(track_img);
	}

})(sauberfant);
